package com.xbongbong.pro.message.pojo;/*/*/

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

/**
 * push表ref_type字段封装pojo
 * @author 魏荣杰
 * @date 2019/4/5 9:35
 * @since v1.0
 * @version v1.0
 */
@Setter
@Getter
@ToString
public class PushRefTypePojo {
    /**
     * 跳转类型
     * @see com.xbongbong.pro.message.enums.MessagePushRefTypeEnum
     */
    private String type;
    /**
     * 跳转url
     */
    private String pcUrl;
    /**
     * 小程序跳转url
     */
    private String weChatUrl;
    /**
     * 跳转需要参数
     */
    private AbstractOptions options;

    public abstract static class AbstractOptions implements Serializable {
        private static final long serialVersionUID = 7244288618940072280L;
    }

    @Setter
    @Getter
    @ToString
    public static class Options extends AbstractOptions {
        private static final long serialVersionUID = 4424536356370347125L;
        /**
         * 应用id
         */
        private Long appId;
        /**
         * 菜单id
         */
        private Long menuId;
        /**
         * 表单id
         */
        private Long formId;
        /**
         * 数据id
         */
        private Long dataId;
        /**
         * 数据ids
         */
        private List<Long> dataIds;
        /**
         * 是否是saas标记
         */
        private Integer saasMark;
        /**
         * 业务类型
         */
        private Integer businessType;
        /**
         * 业务子类型
         */
        private Integer subBusinessType;
        /**
         * 开始时间（销售简报用）
         */
        private Long start;
        /**
         * 结束时间（销售简报用）
         */
        private Long end;
        /**
         * 下载用url（目前只有导出）
         */
        private String downloadUrl;
        /**
         * 任务id
         */
        private Long processTaskId;
        /**
         * 任务结点id
         */
        private Long processNodeTaskId;
        /**
         * 审批列表类型
         */
        private String processType;
        /**
         * 工作报告统计页面时间筛选
         */
        private List<String> reportDate;
        /**
         * 工作报告统计页面报告类型筛选
         */
        private Integer reportType;
        /**
         * 数据预警图表跳转用
         */
        private Long categoryId;
        /**
         * 数据预警图表跳转用
         */
        private Long chartId;
        /**
         * 数据预警图表跳转用
         */
        private Long dataWarningId;

        /**
         * 经销商标识
         */
        private Integer distributorMark;

        /**
         * Paas表单的menu的name
         */
        private String name;

        public Options() {
        }

        public Options(Long appId, Long menuId, Long formId, Long dataId, List<Long> dataIds, Integer saasMark, Integer businessType, Integer subBusinessType) {
            this.appId = appId;
            this.menuId = menuId;
            this.formId = formId;
            this.dataId = dataId;
            this.dataIds = dataIds;
            this.saasMark = saasMark;
            this.businessType = businessType;
            this.subBusinessType = subBusinessType;
        }

        /**
         * 审批传参专用
         */
        public Options(Long appId, Long menuId, Long formId, List<Long> dataIds, Integer saasMark, Integer businessType, Long processTaskId, Long processNodeTaskId, String processType) {
            this.appId = appId;
            this.menuId = menuId;
            this.formId = formId;
            this.dataIds = dataIds;
            this.saasMark = saasMark;
            this.businessType = businessType;
            this.processTaskId = processTaskId;
            this.processNodeTaskId = processNodeTaskId;
            this.processType = processType;
        }

        /**
         * 通用详情页(除流程外)
         */
        public Options(Long appId, Long menuId, Long formId, Long dataId, Integer saasMark, Integer businessType) {
            this.appId = appId;
            this.menuId = menuId;
            this.formId = formId;
            this.dataId = dataId;
            this.saasMark = saasMark;
            this.businessType = businessType;
        }
        /**
         * 特殊详情页(工作报告、跟进记录、供应商跟进记录、签到、附近客户)
         */
        public Options(Long appId, Long menuId, Long formId, Long dataId, Integer saasMark, Integer businessType, Integer subBusinessType) {
            this.appId = appId;
            this.menuId = menuId;
            this.formId = formId;
            this.dataId = dataId;
            this.saasMark = saasMark;
            this.businessType = businessType;
            this.subBusinessType = subBusinessType;
        }

        /**
         * 左列表右详情(工作报告、跟进记录、供应商跟进记录、签到、附近客户)
         * 通用列表页
         */
        public Options(Long appId, Long menuId, List<Long> dataIds, Integer saasMark, Integer subBusinessType) {
            this.appId = appId;
            this.menuId = menuId;
            this.dataIds = dataIds;
            this.saasMark = saasMark;
            this.subBusinessType = subBusinessType;
        }

        /**
         * 特殊列表页(工单)
         */
        public Options(List<Long> dataIds) {
            this.dataIds = dataIds;
        }

        /**
         * 销售简报
         */
        public Options(Long start, Long end) {
            this.start = start;
            this.end = end;
        }

        public Options(Long appId, Long menuId, List<Long> dataIds, Integer saasMark, Integer subBusinessType, List<String> reportDate, Integer reportType) {
            this.appId = appId;
            this.menuId = menuId;
            this.dataIds = dataIds;
            this.saasMark = saasMark;
            this.subBusinessType = subBusinessType;
            this.reportDate = reportDate;
            this.reportType = reportType;
        }

        /**
         * 经销商专用
         */
        public Options(Long appId, Long menuId, Long formId, Long dataId, List<Long> dataIds, Integer saasMark, Integer businessType, Integer subBusinessType, Integer distributorMark) {
            this.appId = appId;
            this.menuId = menuId;
            this.formId = formId;
            this.dataId = dataId;
            this.dataIds = dataIds;
            this.saasMark = saasMark;
            this.businessType = businessType;
            this.subBusinessType = subBusinessType;
            this.distributorMark = distributorMark;
        }
    }

    @Setter
    @Getter
    @ToString
    public static class CommonDetailOptions extends AbstractOptions {
        private static final long serialVersionUID = -1672255915616591114L;
        private Long appId;
        private Long menuId;
        private Long formId;
        private Long dataId;
        private Integer saasMark;
        private Integer businessType;

        public CommonDetailOptions() {
        }
    }

    @Setter
    @Getter
    @ToString
    public static class SpecialDetailOptions extends AbstractOptions {
        private static final long serialVersionUID = 6544172250394793991L;
        private Long appId;
        private Long menuId;
        private List<Long> dataIds;
        private Integer saasMark;
        private Integer subBusinessType;
        private Integer distributorMark;

        public SpecialDetailOptions() {
        }
    }

    @Setter
    @Getter
    @ToString
    public static class CommonListOptions extends AbstractOptions {
        private static final long serialVersionUID = 7353202830142339263L;
        private Long appId;
        private Long menuId;
        private Integer saasMark;
        private Integer subBusinessType;
        private Integer distributorMark;
        private List<Long> dataIds;

        public CommonListOptions() {
        }
    }

    @Setter
    @Getter
    @ToString
    public static class SpecialListOptions extends AbstractOptions {
        private static final long serialVersionUID = -1070625624601074971L;
        private List<Long> dataIds;

        public SpecialListOptions() {
        }
    }

    @Setter
    @Getter
    @ToString
    public static class MarketingListOptions extends AbstractOptions {
        private static final long serialVersionUID = 7353202830142339263L;
        private Long appId;
        private Long menuId;
        private Long formId;
        private Long dataId;
        private Integer saasMark;
        private Integer businessType;
        private Integer subBusinessType;

        public MarketingListOptions() {
        }
    }
    @Setter
    @Getter
    @ToString
    public static class WorkFlowListOptions extends AbstractOptions {
        private static final long serialVersionUID = 1525670568910829965L;

        private Long appId;
        private Long menuId;
        private Long formId;
        private List<Long> dataIds;
        private Integer saasMark;
        private Integer businessType;
        private Long processTaskId;
        private Long processNodeTaskId;
        private String processType;

        public WorkFlowListOptions() {
        }
    }

    @Setter
    @Getter
    @ToString
    public static class SalesReportOptions extends AbstractOptions {
        private static final long serialVersionUID = -5709657476967448145L;
        private Long start;
        private Long end;

        public SalesReportOptions() {
        }
    }

    @Setter
    @Getter
    @ToString
    public static class DownloadOptions extends AbstractOptions {
        private static final long serialVersionUID = 2219989891958881511L;
        private String downloadUrl;

        public DownloadOptions() {
        }
    }

    @Setter
    @Getter
    @ToString
    public static class DataWarningOptions extends AbstractOptions {
        private static final long serialVersionUID = 2219989891958881511L;
        private boolean showWarn;
        private Long categoryId;
        private Long chartId;
        private Long dataWarningId;

        public DataWarningOptions() {
            this.showWarn = true;
        }
    }

    @Setter
    @Getter
    @ToString
    public static class StatisticOptions extends AbstractOptions {
        private List<String> reportDate;
        private Integer reportType;

        public StatisticOptions() {
        }
    }
}
